
#define INFINITY INT_MAX
#define MAX_VERTEX_NUM 20


typedef enum{DG,DN,UDG,UDN} GraphKind;

typedef struct ArcCell
{
	int adj;
	char *info;
}ArcCell,AdjMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM],ShortPathTable[MAX_VERTEX_NUM];

typedef struct
{
	char vers[MAX_VERTEX_NUM];
	AdjMatrix arcs;
	int vexnum,arcnum;
	GraphKind kind;
}MGraph;



typedef struct  
{
	char adjvex;
	int lowcost;
}Closedge[MAX_VERTEX_NUM];

typedef bool PathMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];




int LocateVex(MGraph &G,char v);
int CreateUDN(MGraph &G);
int CreateDG(MGraph &G);
int CreateDN(MGraph &G);
int CreateUDG(MGraph &G);
void Print(MGraph G,int v);
int NextAdjVex(MGraph G,int v,int w);
void DFS(MGraph G,int v);
void DFSTraverse(MGraph G);
void BFSTraverse(MGraph G);
int CreateGraph(MGraph &G);
//int mininum(Closedge closedge);
//void MiniSpanTree_Prim(MGraph G,char u);
void ShortestPath_DIJ(MGraph G,int v0,PathMatrix &p,ShortPathTable &D);







